package com.zmn.plat.test;

import com.zmn.manager.common.database.config.OneMasterMultiSlaveDataSourceConfiguration;
import org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.PropertySource;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication(exclude = {RabbitAutoConfiguration.class, DataSourceAutoConfiguration.class, JmxAutoConfiguration.class
        , QuartzAutoConfiguration.class,
        ThymeleafAutoConfiguration.class,
        DubboAutoConfiguration.class,
//        DispatcherServletAutoConfiguration.class,
//        EmbeddedWebServerFactoryCustomizerAutoConfiguration.class,
//        ServletWebServerFactoryAutoConfiguration.class,
})
@ComponentScan(basePackages = "com.zmn", lazyInit = true, excludeFilters = {@ComponentScan.Filter(type = FilterType.REGEX,
        pattern = {
                "com.zmn.ums.manager.impl.shiro.*"
                , "com.zmn.manager.dubbo.config.*"
                , "com.zmn.plat.manager.config.*"
                , "com.zmn.plat.services.config.KuaiDi100Config"

        })})
@EnableCaching
@EnableTransactionManagement
//@EnableElasticsearchRepositories(basePackageClasses = {EsPartSkuWorkRepository.class,})
@ImportAutoConfiguration({/*ZmnMQConfiguration.class, */OneMasterMultiSlaveDataSourceConfiguration.class})
@PropertySource(value = "file:/a/config-repo/plat/admin.properties", ignoreResourceNotFound = true, encoding = "UTF-8")
public class ZmnPlatServiceApplication {

    public static void main(String[] args) {
        try {
            SpringApplication.run(ZmnPlatServiceApplication.class, args);
        } catch (Exception e) {

        }
    }

}
